<template>
	<view>
		<bg-video></bg-video>
		<view style="height: 100vh;" class="flex flex-direction justify-center">
			<view class="flex-direction justify-center padding margin">
				<view class="margin-tb flex justify-start border-bottom align-center">
					<text class="cuIcon-profilefill text-color"></text>
					<input v-model="account" class="text-color padding-lr-sm" type="text" placeholder="请输入运营商账户" />
				</view>
				<view class="margin-tb flex justify-start border-bottom align-center">
					<text class="cuIcon-unlock text-color"></text>
					<input v-model="password" class="text-color padding-lr-sm" type="password" placeholder="请输入运营商密码" />
				</view>
				<view class="margin-tb">
					<view @tap="checkDistributor" class="bg-color text-color text-center padding border">登录</view>
				</view>
				
			</view>
		</view>
	</view>
	
</template>

<script>
	export default {
		data: function() {
			return {
				account: "",
				password: "",
			};
		},
		methods: {
			checkDistributor: function() {
				let self = this;
				this.http.put({
					url: "/distributor/permission",
					param: {
						account: this.account,
						password: this.password
					}
				}).then(function(res) {
					console.log(res);
					self.store.commit("setDistributor", res);
					
					uni.redirectTo({
						url: "../record/new",
						success:function(){
							console.log("1");
						},
						fail:function(err){
							console.log(err);
						}
					});
					
				});
			}
		}
	}
</script>

<style scoped>
	.border {
		border: 1px solid #FFFFFF;
	}
</style>
